//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.tool.btn;

import com.tool.image.ImageMixDeal;
import com.tool.role.RoleData;
import com.tool.tcpimg.UIUtils;
import come.tool.Fighting.FightingMixDeal;
import io.netty.util.internal.StringUtil;
import java.awt.Color;
import java.awt.Desktop;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.come.Frame.RechargeWebJframe;
import org.come.Frame.ZhuFrame;
import org.come.bean.ConfigureBean;
import org.come.model.Configure;
import org.come.socket.DownLoadTxt;
import org.come.socket.GameClient;
import org.come.until.FormsManagement;
import org.come.until.UserMessUntil;

public class TextBtn extends MoBanBtn {
    private int caozuo;
    private String petList;

    public TextBtn(String iconpath, int type, String text, String caozuo) {
        super(iconpath, type);
        this.petList = caozuo;
        this.setText(text);
        this.setFont(UIUtils.TEXT_FONT1);
        this.setForeground(new Color(255, 255, 255));
        this.setVerticalTextPosition(0);
        this.setHorizontalTextPosition(0);
    }

    public TextBtn(String iconpath, int type, String text, int caozuo) {
        super(iconpath, type);
        this.caozuo = caozuo;
        this.setText(text);
        this.setFont(UIUtils.TEXT_FONT);
        if (caozuo == 5) {
            this.setForeground(Color.yellow);
        } else {
            this.setForeground(Color.white);
        }

        this.setVerticalTextPosition(0);
        this.setHorizontalTextPosition(0);
    }

    @Override
    public void chooseyes() {
    }

    @Override
    public void chooseno() {
    }

    @Override
    public void nochoose(MouseEvent e) {
        if (this.petList != null) {
            String[] list = this.petList.split(",");
            "petlist".equals(list[0]);
        } else {
            switch(this.caozuo) {
            case 1:
                if (FightingMixDeal.State == 0) {
                    try {
                        String url = (new DownLoadTxt()).GetServerTxt("yueka.txt");
                        if (StringUtil.isNullOrEmpty(url)) {
                            ZhuFrame.getZhuJpanel().addPrompt2("暂未开放");
                            return;
                        }

                        Desktop desktop = Desktop.getDesktop();
                        URI uri = new URI(url);
                        desktop.browse(uri);
                    } catch (IOException var5) {
                        var5.printStackTrace();
                    } catch (Exception var6) {
                        var6.printStackTrace();
                    }
                }
            case 2:
            case 3:
            case 4:
            case 888:
            	this.complainOpenWeb();
            }
        }

    }
    public void complainOpenWeb() {


        final Integer num = (Integer) FormsManagement.map.get(Integer.valueOf(3082));
        if (num == null) {
            FormsManagement.showForm(3082);
        }
        RechargeWebJframe.getRankingListJframe().setBounds(0, 0, 1024+500, 1000);// 设置窗口出现的位置
        FormsManagement.HideForm( 39);
//        StringBuffer sb = new StringBuffer();
//        sb.append(url);
//        String stringParams = sb.toString();
//        Desktop desktop = Desktop.getDesktop();
//        try {
//            desktop.browse(new URI(stringParams));
//        } catch (IOException var7) {
//            var7.printStackTrace();
//        } catch (URISyntaxException var8) {
//            var8.printStackTrace();
//        }

    }
}
